package com.hean.activity;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class PhoneActivity extends Activity {
	private EditText phoneText;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        phoneText=(EditText) this.findViewById(R.id.phonenumber);
        Button button=(Button) this.findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				String phonenumber=phoneText.getText().toString();
				Intent intent=new Intent(Intent.ACTION_CALL, Uri.parse("tel:"+phonenumber));
				PhoneActivity.this.startActivity(intent);//startActivity(intent);也可以
			}
		});
    }
}